import Vue from 'vue'
import Router from 'vue-router'
import Layout from '../layout/index'
Vue.use(Router)
export const constantRouterMap = [
  {
    path: '/login',
    meta: { title: '登录', noCache: true },
    component: resolve => require(['@/views/login'], resolve),
    hidden: true
  },
  {
    path: '/oauth/login',
    meta: { title: '用户绑定', noCache: true },
    component: resolve => require(['@/views/login/index.vue'], resolve),
    hidden: true
  },
  {
    path: '/s/login',
    meta: { title: '用户登录', noCache: true },
    component: resolve => require(['@/views/auth/Login.vue'], resolve),
    hidden: true
  },
  {
    path: '/schedule',
    meta: { title: '日程', noCache: true },
    component: resolve => require(['@/views/schedule'], resolve),
    hidden: true
  },
  {
    path: '/404',
    component: resolve => require(['@/views/features/404'], resolve),
    hidden: true
  },
  {
    path: '/500',
    component: resolve => require(['@/views/features/401'], resolve),
    hidden: true
  },
  {
    path: '/401',
    component: resolve => require(['@/views/features/401'], resolve),
    hidden: true
  },
  {
    path: '/uc/more',
    component: resolve => require(['@/portal4.1/pc/component/more/More.vue'], resolve),
    hidden: true
  },
  {
    path: '/uc/entity',
    component: resolve => require(['@/portal4.1/components/open'], resolve),
    hidden: true
  },
  {
    path: '/uc/mobile',
    component: resolve => require(['@/portal4.1/mobile/index'], resolve),
    hidden: true
  },
  {
    path: '/uc/id-card',
    component: resolve => require(['@/portal4.1/pc/component/id-card/IdCard.vue'], resolve),
    hidden: true
  },
  {
    path: '/uc/redirect',
    component: resolve => require(['@/views/features/code.vue'], resolve),
    hidden: true
  },
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path*',
        component: resolve => require(['@/views/features/redirect'], resolve)
      }
    ]
  },
  {
    path: '/dashboard',
    component: Layout,
    redirect: '/dashboard/index',
    children: [
      {
        path: '/dashboard/index',
        component: resolve => require(['@/views/home'], resolve),
        name: 'Dashboard',
        meta: { title: '首页', icon: 'index', affix: true, noCache: true }
      }
    ]
  },
  {
    path: '/s/download',
    component: resolve =>
      require(['@/template/ResourecsDownload/index'], resolve),
    hidden: true
  },
  {
    path: '/',
    hidden: true,
    component: resolve => require(['@/portal4.1/manager/index'], resolve)
  },
  {
    path: '/uc/mobile',
    component: resolve => require(['@/portal4.1/mobile/index'], resolve),
    hidden: true
  },
  {
    path: '/uc/index',
    component: resolve => require(['@/portal4.1/pc/index'], resolve),
    hidden: true
  },
  {
    path: '/uc/query',
    component: resolve => require(['@/portal4.1/pc/component/query/Query.vue'], resolve),
    hidden: true
  },
  {
    path: '/uc/service/manager',
    component: resolve => require(['@/views/system/service/index'], resolve),
    hidden: true
  },
  {
    path: '/uc/auth',
    component: resolve => require(['@/portal4.1/common/utils'], resolve),
    hidden: true
  },
  {
    path: '/uc/rc',
    component: resolve => require(['@/template/ScheduleTemplate/AppScheduleTemplate/AppCalandar.vue'], resolve),
    hidden: true
  },
  {
    path: '/uc/dashboard',
    component: resolve => require(['@/livebos/index'], resolve),
    hidden: true
  }
]

export default new Router({
  mode: 'history',
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})
